package jdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo2_2 {
    public static void main(String[] args) {
        try ( Connection connection = DBUtil1.getConnection();){
            Statement statement = connection.createStatement();
            String sql = "insert into teacher(name,salary) values('王克晶',5000)";
       int num= statement.executeUpdate(sql);
       if(num>0){
           System.out.println("插入成功");
       }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
